var gulp = require('gulp'),
    sass= require('gulp-sass'),
    //imagemin = require('gulp-imagemin'),
    cleanCSS = require('gulp-clean-css'),
    cache = require('gulp-cache'),
    clean = require("gulp-clean"),
    gutil = require("gulp-util");


gulp.task('clean',function(){
    return gulp.src(['build','dist','rev','temp'],{read:false}).pipe(clean());
});


// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
    return gulp.src("app/sass/*.scss")
         // .pipe(plumber())
          .pipe(sass())           
          .pipe(cleanCSS())    
          .pipe(gulp.dest("build/css"))
          .pipe(gulp.dest('dist/css'))
});



gulp.task('font',function(){
    return gulp.src(['./app/font/**/*','./app/css/**/*.css'])
         .pipe(gulp.dest('build/font'))
          .pipe(gulp.dest('dist/font'));
})

gulp.task('images', function() {
  return gulp.src('./app/images/**/*')

  
    /*.pipe(cache(imagemin({
        optimizationLevel: 3,
        progressive: true,
        interlaced: true
    })))*/
    .pipe(gulp.dest("build/images"))
    .pipe(gulp.dest('dist/images'))
});

gulp.task('index', function() {
return gulp.src("./app/**/*.html")
  .pipe(gulp.dest('./build'))
  .pipe(gulp.dest('./dist'));
});

/*gulp.task('favicon', function() {
    return gulp.src("./app/favicon.ico")
     .pipe(gulp.dest('./dist'));
});

gulp.task("build",['clean'],function(){
    gulp.run("build1")
})
gulp.task("build1",['sass','images','font','index','favicon'])

*/
